dropdown: Make the popup as wide as the button
authorMatthias Clasen <mclasen@redhat.com>
Thu, 11 Jun 2020 22:29:58 +0000 (18:29 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 11 Jun 2020 22:29:58 +0000 (18:29 -0400)
Having narrow popups on a wide button looks awkward.
Do the same as the combo box, and ensure the popup
is at least as wide as the button.

gtk/gtkdropdown.c

index 6674a8ba3518fd5413fcea89ff2644c477eba793..c0a37f40893363948d7140117cdd3f0670ea8090 100644 (file)
@@ -396,6 +396,8 @@ gtk_drop_down_size_allocate (GtkWidget *widget,
 
   gtk_widget_size_allocate (self->button, &(GtkAllocation) { 0, 0, width, height }, baseline);
 
+  gtk_widget_set_size_request (self->popup, width, -1);
+
   gtk_native_check_resize (GTK_NATIVE (self->popup));
 }